package com.rookie.rookiemeeting.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.rookie.rookiemeeting.dto.MypassDto;
import com.rookie.rookiemeeting.entity.Mypass;
import com.rookie.rookiemeeting.mapper.MypassMapper;
import com.rookie.rookiemeeting.service.IMypassService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author henry-ong
 * @since 2023-12-23
 */
@Service
@Transactional
public class MypassServiceImpl extends ServiceImpl<MypassMapper, Mypass> implements IMypassService {

    MypassMapper mypassMapper;

    @Autowired
    public MypassServiceImpl(MypassMapper mypassMapper) {
        this.mypassMapper = mypassMapper;
    }

    @Override
    public List<MypassDto> getCurrentModeById(String id) {
        return mypassMapper.getCurrentOne(id);
    }

    @Override
    public Integer addTestInfo(Mypass mypass) {
        return mypassMapper.addTestInfo(mypass);
    }

    @Override
    public List<Mypass> queryAll() {
        return mypassMapper.queryAll();
    }

    @Override
    public Page<MypassDto> queryTestInfoByEmployee(Page<MypassDto> page, String employeename) {
        return mypassMapper.queryTestInfoByEmployee(page, employeename);
    }
}
